<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/
//路由器
Route::get('/', function () {
    return view('welcome');
});

//参数限制
Route::get('/user/{name}' , function($name){
    return $name;
})->where('name' , '^\w+$');
//Admin文件夹下的TestController控制器中的index方法
//注意正反斜杠 /表示参数 \表示路径
Route::get('/test','Admin\TestController@test3');

Route::get('/msg/test/{id}' , 'MsgController@test');
//完整的增删改查

//按规划写出如下路由器
//留言列表
Route::get('msg/index' , 'MsgController@index');
//展示列表
Route::get('msg/add' , 'MsgController@add');
//接收post数据并入库
Route::post('msg/addpost' , 'MsgController@addPost');
//删除留言
Route::get('msg/del/{id}' , 'MsgController@del');
Route::get('msg/show/{id}' , 'MsgController@show');
//修改留言
// Route::match(['get','post'],'msg/up/{id}','MsgController@up');
Route::match(['get','post'],'msg/up/{id}' , 'MsgController@up');
//php artisan make:controller MsgController
Route::get('ceshi','Admin\TestController@shows');
